Http Codes
The Sinch API can return the following HTTP codes:
2xx - Success
Any 2xx response is considered a successful response. Response bodies will differ depending on the request. Refer to documentation of particular endpoint for details.
3xx - Redirect
Some Data Verification endpoints may return HTTP 3xx (redirection) status codes. It is essential to follow these redirects to ensure proper execution of the business process. Only bypass the redirect if you have a specific and justified reason for doing so.
400 - BadRequest
400 errors generally concern the construction or format of the request you submitted. For example, missing required parameters or the using the wrong parameter in a request. The following examples all show different types of 400 errors:
- Error when required field is missing in Verification Request.
{
"errorCode": 40001,
"message": "Missing required field in the request"
}
- Error when Number/MSISDN is short.
{
"errorCode": 40001,
"message": "Number xxxx4 is invalid. Too short."
}
- Error when Authorization header is invalid.
{
"errorCode": 40100,
"message": "Invalid authorization header"
}
- Error when x-timestamp header is missing.
{
"errorCode": 40101,
"message": "X-Timestamp required"
}
- Error when Signature is invalid for the request.
{
"errorCode": 40102,
"message": "Invalid signature"
}
- Error when Authorization header is missing.
{
"errorCode": 40104,
"message": "Authorization required"
}
- Error when some part of your authentication is incorrect. You can fix this by ensuring your authorization configuration is configured correctly.
{
"errorCode": 40107,
"message": "Invalid authorization"
}
- Error when callback url is not set for appId with Public Authorization enabled.
{
"errorCode": 40303,
"message": "Callback URL must be set when using public authorization method."
}
- Error when request is denied by enterprise callback url.
{
"errorCode": 40304,
"message": "Request Denied by Callback URL."
}
- Error when configurations for appId are missing.
{
"errorCode": 40400,
"message": "Requested resource was not found."
}
- Error when user ip is not in the valid telco ip range.
{
"errorCode": 42201,
"message": "No route to destination."
}
500 - Internal Server Error
500 errors are general server errors that are temporary, and you usually can't do anything about. Try the request a little later or contact support if you receive this error repeatedly after a period of time.
{
"errorCode": 50000,
"message": "Internal server error."
}